import Vue from 'vue';
import Router from 'vue-router';
import login from '@/views/login';
import index from '@/views/index';

import userList from '@/views/user/userList';
import salary from '@/views/user/salary';

import foodList from '@/views/food/foodList';
import foodListMenu from '@/views/food/foodListMenu';

import materialList from '@/views/material/materialList';
import materialLog from '@/views/material/materialLog';

import orderList from '@/views/order/orderList';

import purchaseLog from '@/views/purchase/purchaseLog';
import purchaseLogAdmin from '@/views/purchase/purchaseLogAdmin';

import saleLog from '@/views/saleLog/saleLog';
import billExport from '@/views/saleLog/billExport';
import MaterialStatistic from '@/views/saleLog/MaterialStatistic';

// 启用路由
Vue.use(Router);

// 导出路由 
export default new Router({
    routes: [{
        path: '/',
        name: '',
        component: login,
        hidden: true,
        meta: { requireAuth: false }
    }, {
        path: '/login',
        name: '登录',
        component: login,
        hidden: true,
        meta: { requireAuth: false }
    }, {
        path: '/index',
        name: 'index',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [
            {
                path: '/user/userList',
                name: '用户管理',
                component: userList,
                meta: { requireAuth: true }
            },
            {
                path: '/food/foodList',
                name: '菜品管理',
                component: foodList,
                meta: { requireAuth: true }
            },
            {
                path: '/food/foodListMenu',
                name: '菜单管理',
                component: foodListMenu,
                meta: { requireAuth: true }
            },
            {
                path: '/material/materialList',
                name: '库存管理',
                component: materialList,
                meta: { requireAuth: true }
            },
            {
                path: '/material/materialLog',
                name: '库存记录',
                component: materialLog,
                meta: { requireAuth: true }
            },
            {
                path: '/order/orderList',
                name: '订单管理',
                component: orderList,
                meta: { requireAuth: true }
            },
            {
                path: '/purchase/purchaseLog',
                name: '采购管理',
                component: purchaseLog,
                meta: { requireAuth: true }
            },
            {
                path: '/purchase/purchaseLogAdmin',
                name: '采购管理',
                component: purchaseLogAdmin,
                meta: { requireAuth: true }
            },
            {
                path: '/user/salary',
                name: '薪资管理',
                component: salary,
                meta: { requireAuth: true }
            },
            {
                path: '/saleLog/saleLog',
                name: '销售记录',
                component: saleLog,
                meta: { requireAuth: true }
            },
            {
                path: '/saleLog/billExport',
                name: '账单导出',
                component: billExport,
                meta: { requireAuth: true }
            },
            {
                path: '/saleLog/MaterialStatistic',
                name: '今日统计',
                component: MaterialStatistic,
                meta: { requireAuth: true }
            },
        ]
    }]
})